<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class orders extends Model
{
    public $table = 'orders';
    public $timestamps = false;
    protected $fillable = [];
    public $primaryKey = "id";

    protected function lists($openid, $page)
    {
        $pageSize = 20;
        $offset = $pageSize*($page-1);
        $list = $this->where(['openid'=>$openid, 'is_del'=>0])->take(8)->skip($offset)->get()->toArray();
        return $list;
    }
}
